<?php
/*由bean脚本生成 powerBy--joe*/
namespace app\common\validate;

use app\common\bean\UserImageBean;

class UserImageValidate extends BaseValidate
{

	static $all = 'all';
	static $add = 'add';
	static $edit = 'edit';
	static $pkId = 'id';

	public function __construct(array $rules = [], array $message = [], array $field = [])
	{
		parent::__construct($rules, $message, $field);
		$this->rule = [
			 UserImageBean::$id => 'require', //
			 UserImageBean::$userId => 'require', //
			 UserImageBean::$pic => 'require|max:255', //图片地址
			 UserImageBean::$createdAt => 'require', //
			 UserImageBean::$updatedAt => 'require', //
			 UserImageBean::$type => 'require', //1图片2文档
		];
		$this->message = [
			UserImageBean::$id.POINST."require " => 'id必须', //
			UserImageBean::$userId.POINST."require " => 'user_id必须', //
			UserImageBean::$pic.POINST."require " => 'pic必须', //图片地址
			UserImageBean::$createdAt.POINST."require " => 'created_at必须', //
			UserImageBean::$updatedAt.POINST."require " => 'updated_at必须', //
			UserImageBean::$type.POINST."require " => 'type必须', //1图片2文档
		];
		$this->scene = [
			self::$all => [
				UserImageBean::$id,
				UserImageBean::$userId,
				UserImageBean::$pic,
				UserImageBean::$createdAt,
				UserImageBean::$updatedAt,
			],
			self::$add => [
                UserImageBean::$userId,
                UserImageBean::$pic,
                UserImageBean::$createdAt,
			],
			self::$edit => [
                UserImageBean::$id,
                UserImageBean::$userId,
                UserImageBean::$pic,
                UserImageBean::$createdAt,
			],
			self::$pkId => [UserImageBean::$id],

		];
	}


}
